<?php
class ORMSampleAttribute extends ORMBase {
  public function __construct() {
    parent::__construct('SampleAttribute');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    require_once dirname(__FILE__) . '/ORMSampleAttributeOption.class.php';
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->name = isset($object->name) ? $object->name : '';
    if (isset($epObject->options)) {
      $epObject->options->removeAll();
      foreach ($object->options as &$item) {
        $epObject->options[] = $this->__getEpObject_4_lvl_1_object($myManager, $item, new ORMSampleAttributeOption(), 'SampleAttributeOption');
      }
    }
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    require_once dirname(__FILE__) . '/ORMSampleAttributeOption.class.php';
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->name = $epObject->name;
    $object->options = array();
    if (isset($epObject->options)) {
      foreach ($epObject->options as &$item) {
        $object->options[] = $this->__getObject_4_lvl_1_ep_object($myManager, $item, new ORMSampleAttributeOption());
      }
    }
    return $object;
  }
}
?>
